package com.md.api.controller;

import com.md.api.entity.AdvertisementInfo;
import com.md.api.entity.HttpResult;
import com.md.api.entity.dto.ComposeQueryDto;
import com.md.api.service.AdvertService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RequestMapping("/advert")
@RestController
public class AdvertController {


	@Resource
	AdvertService advertService;





	@RequestMapping("/getByType")
	@ResponseBody
	public HttpResult getByType(@RequestBody ComposeQueryDto queryDto) {
		if (null==queryDto.getAdType()){
			return HttpResult.PARAM_ERROR;
		}
		return advertService.getByType(queryDto);
	}



}
